package com.example.exam.service;

import org.springframework.lang.Nullable;

import java.util.Map;

/**
 * @author
 * @date 2023/3/14
 */
public interface RedisService {

    void del(String... key);

    //--------------String----------------

    Object getObject(String key);

    boolean setObject(String key, Object value);

    boolean setObject(String key, Object value, long time);

    boolean setIfAbsent(String key, Object value);

    boolean setIfAbsent(String key, Object value, long time);

    boolean setIfPresent(String key, Object value);

    boolean setIfPresent(String key, Object value, long time);

    long sizeObject(String key);

    long incrementObject(String key, long delta);

    long incrObject(String key, long delta);

    long decrObject(String key, long delta);

    boolean append(String key, @Nullable String var2);

    //---------------Map------------------

    Object getMap(String key, String mapKey);

    Map getMap(String key);

    boolean setMap(String key, Map map);

    boolean setMap(String key, Map map, long time);

    boolean setMap(String key, String mapKey, Object vale);

    boolean setMap(String key, String mapKey, Object value, long time);

    long delMap(String key, Object... mapKey);

    boolean selMap(String key, String mapKey);

    double incrementMap(String key, String mapKey, double by);

    double incrMap(String key, String mapKey, double by);

    double decrMap(String key, String mapKey, double by);
}
